package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.SysMessageStatus;
import com.rockcent.mall.lib.domain.enumclass.SysMessageType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by zhangjh on 2017/5/22.
 */
@Entity
@Table(name = "sys_message_user")
@DynamicInsert
@DynamicUpdate
public class SysMessageUser extends IDEntityMall {

    /**
     * 用户id
     */
    @Column(columnDefinition = "bigint comment '用户id'")
    private Long userId;

    /**
     * 用户账号
     */
    @Column(columnDefinition = "varchar(50) comment '用户账号'")
    private String username;

    /**
     * 消息id
     */
    @Column(columnDefinition = "bigint comment '消息id'")
    private Long msgId;

    /**
     * 状态
     */
    @Column(columnDefinition = "varchar(10)")
    @Enumerated(EnumType.STRING)
    private SysMessageStatus status;

    /**
     * 平台ID
     */
    @Column(columnDefinition = "bigint(20) comment '平台ID'")
    private Long mallId;

    /**
     * 商户ID
     */
    @Column(columnDefinition = "bigint(20) comment '商户ID'")
    private Long merchantId;

    /**
     * 接收消息的平台ID
     */
    @Column(columnDefinition = "bigint(20) comment '接收消息的平台ID'")
    private Long destinationTerminalId;

    public Long getDestinationTerminalId() {
        return destinationTerminalId;
    }

    public void setDestinationTerminalId(Long destinationTerminalId) {
        this.destinationTerminalId = destinationTerminalId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Long getMsgId() {
        return msgId;
    }

    public void setMsgId(Long msgId) {
        this.msgId = msgId;
    }

    public SysMessageStatus getStatus() {
        return status;
    }

    public void setStatus(SysMessageStatus status) {
        this.status = status;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    @Override
    public String toString() {
        return "SysMessageUser{" +
                "userId=" + userId +
                ", username='" + username + '\'' +
                ", msgId=" + msgId +
                ", status=" + status +
                ", mallId=" + mallId +
                ", merchantId=" + merchantId +
                ", destinationTerminalId=" + destinationTerminalId +
                '}';
    }
}
